3.709 \(\int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))}{a+i a \tan (e+f x)} \, dx\)

Optimal. Leaf size=57 \[ -\frac {c (A+i B)}{a f (-\tan (e+f x)+i)}+\frac {B c \log (\cos (e+f x))}{a f}-\frac {i B c x}{a} \]

[Out]

-I*B*c*x/a+B*c*ln(cos(f*x+e))/a/f-(A+I*B)*c/a/f/(-tan(f*x+e)+I)

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3588, 43} \[ -\frac {c (A+i B)}{a f (-\tan (e+f x)+i)}+\frac {B c \log (\cos (e+f x))}{a f}-\frac {i B c x}{a} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]))/(a + I*a*Tan[e + f*x]),x]

[Out]

((-I)*B*c*x)/a + (B*c*Log[Cos[e + f*x]])/(a*f) - ((A + I*B)*c)/(a*f*(I - Tan[e + f*x]))

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))}{a+i a \tan (e+f x)} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {A+B x}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (\frac {-A-i B}{a^2 (-i+x)^2}-\frac {B}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i B c x}{a}+\frac {B c \log (\cos (e+f x))}{a f}-\frac {(A+i B) c}{a f (i-\tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 1.58, size = 124, normalized size = 2.18 \[ \frac {c \cos (e+f x) (A+B \tan (e+f x)) \left (\tan (e+f x) \left (-i A+B \log \left (\cos ^2(e+f x)\right )+B\right )+A-2 i B \tan ^{-1}(\tan (f x)) (\tan (e+f x)-i)-i B \log \left (\cos ^2(e+f x)\right )+i B\right )}{2 a f (\tan (e+f x)-i) (A \cos (e+f x)+B \sin (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]))/(a + I*a*Tan[e + f*x]),x]

[Out]

(c*Cos[e + f*x]*(A + B*Tan[e + f*x])*(A + I*B - I*B*Log[Cos[e + f*x]^2] + ((-I)*A + B + B*Log[Cos[e + f*x]^2])
*Tan[e + f*x] - (2*I)*B*ArcTan[Tan[f*x]]*(-I + Tan[e + f*x])))/(2*a*f*(A*Cos[e + f*x] + B*Sin[e + f*x])*(-I +
Tan[e + f*x]))

________________________________________________________________________________________

fricas [A]  time = 0.74, size = 67, normalized size = 1.18 \[ \frac {{\left (-4 i \, B c f x e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, B c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + {\left (i \, A - B\right )} c\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(-4*I*B*c*f*x*e^(2*I*f*x + 2*I*e) + 2*B*c*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + (I*A - B)*c)*
e^(-2*I*f*x - 2*I*e)/(a*f)

________________________________________________________________________________________

giac [B]  time = 1.88, size = 130, normalized size = 2.28 \[ \frac {\frac {B c \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a} - \frac {2 \, B c \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a} + \frac {B c \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a} + \frac {3 \, B c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, A c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 8 i \, B c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 3 \, B c}{a {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{2}}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

(B*c*log(tan(1/2*f*x + 1/2*e) + 1)/a - 2*B*c*log(tan(1/2*f*x + 1/2*e) - I)/a + B*c*log(tan(1/2*f*x + 1/2*e) -
1)/a + (3*B*c*tan(1/2*f*x + 1/2*e)^2 - 2*A*c*tan(1/2*f*x + 1/2*e) - 8*I*B*c*tan(1/2*f*x + 1/2*e) - 3*B*c)/(a*(
tan(1/2*f*x + 1/2*e) - I)^2))/f

________________________________________________________________________________________

maple [A]  time = 0.22, size = 64, normalized size = 1.12 \[ \frac {i c B}{f a \left (\tan \left (f x +e \right )-i\right )}+\frac {c A}{f a \left (\tan \left (f x +e \right )-i\right )}-\frac {c B \ln \left (\tan \left (f x +e \right )-i\right )}{f a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x)

[Out]

I/f*c/a/(tan(f*x+e)-I)*B+1/f*c/a/(tan(f*x+e)-I)*A-1/f*c/a*B*ln(tan(f*x+e)-I)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 8.46, size = 54, normalized size = 0.95 \[ \frac {-\frac {B\,c}{a}+\frac {A\,c\,1{}\mathrm {i}}{a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}-\frac {B\,c\,\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}{a\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(c - c*tan(e + f*x)*1i))/(a + a*tan(e + f*x)*1i),x)

[Out]

((A*c*1i)/a - (B*c)/a)/(f*(tan(e + f*x)*1i + 1)) - (B*c*log(tan(e + f*x) - 1i))/(a*f)

________________________________________________________________________________________

sympy [A]  time = 0.39, size = 116, normalized size = 2.04 \[ - \frac {2 i B c x}{a} + \frac {B c \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \begin {cases} - \frac {\left (- i A c + B c\right ) e^{- 2 i e} e^{- 2 i f x}}{2 a f} & \text {for}\: 2 a f e^{2 i e} \neq 0 \\x \left (\frac {2 i B c}{a} + \frac {i \left (- i A c - 2 B c e^{2 i e} + B c\right ) e^{- 2 i e}}{a}\right ) & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))/(a+I*a*tan(f*x+e)),x)

[Out]

-2*I*B*c*x/a + B*c*log(exp(2*I*f*x) + exp(-2*I*e))/(a*f) + Piecewise((-(-I*A*c + B*c)*exp(-2*I*e)*exp(-2*I*f*x
)/(2*a*f), Ne(2*a*f*exp(2*I*e), 0)), (x*(2*I*B*c/a + I*(-I*A*c - 2*B*c*exp(2*I*e) + B*c)*exp(-2*I*e)/a), True)
)

________________________________________________________________________________________